﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8"/>
    <title>超时处理规则</title>
     <script language="JavaScript" src="../../Comm/JScript.js" type="text/javascript" ></script>
    <script type="text/javascript" src="../../Scripts/bootstrap/js/jquery.min.js"></script>
    <script src="../../Scripts/QueryString.js" type="text/javascript"></script>
    <link href="../../../DataUser/Style/ccbpm.css" rel="stylesheet"  type="text/css" />

    <!-- 引用通用的js文件. -->
    <script type="text/javascript" src="../../Scripts/config.js"></script>
    <script type="text/javascript" src="../../Comm/Gener.js"></script>
    <script type="text/javascript" language="javascript" >
        //页面启动函数.
        $(function () {

            $("#Msg").html("<img src='../../Img/loading.gif' />&nbsp;正在加载,请稍后......");

            $.ajax({
                type: 'post',
                async: true,
                url: Handler + "?DoType=CHOvertimeRole_Init&FK_Node=" + GetQueryString("FK_Node") + "&KeyOfEn=" + GetQueryString("KeyOfEn") + "&m=" + Math.random(),
                dataType: 'html',
                success: function (json) {

                    if (json.indexOf('err@') == 0) {
                        alert(json);
                        return;
                    }

                    json = JSON.parse(json);

                    var nodeEntity = json['Node'][0];
                    var nodes = json['Nodes'];

                    //绑定数据源.
                    GenerBindDDL("DDL_Nodes", nodes, "NodeID", "Name", nodeEntity.DoOutTime);

                    if (nodeEntity.OutTimeDeal == 3) {
                        //自动移交到指定的人员.
                        document.getElementById("TB_Shift").value = nodeEntity.DoOutTime;
                    }

                    if (nodeEntity.OutTimeDeal == 4) {
                        //向指定的人员发送消息.
                        document.getElementById("TB_SendEmps").value = nodeEntity.DoOutTime;
                    }

                    if (nodeEntity.OutTimeDeal == 6) {
                        //执行SQL.
                        document.getElementById("TB_SQL").value = nodeEntity.DoOutTime;
                    }

                    //  if (nodeEntity.IsEval == 1)
                    //   document.getElementById("TB_SQL").value = nodeEntity.DoOutTime;

                    //调用公共类库的方法:执行批量主表赋值.
                    GenerFullAllCtrlsVal(nodeEntity);
                    return;
                }
            });

            $("#Msg").html("");
        });
    </script>
</head>
<body >

<form id="cc">

<table style="width:100%;">
<tr>
<th> 超时处理规则</th>
</tr>

<tr>
<td>
<fieldset>
<legend><input type="radio" value="0"  id="RB_OutTimeDeal_0" name="RB_OutTimeDeal" /> <label for="RB_OutTimeDeal_0">不处理 </label> </legend>
<ul style=" color:Gray">
<li>超时的时候一直处理超时的状态。</li>
</ul>
</fieldset>


<fieldset>
<legend><input type="radio" value="1"  id="RB_OutTimeDeal_1" name="RB_OutTimeDeal" /> <label for="RB_OutTimeDeal_1">自动向下运动 </label> </legend>

<ul style=" color:Gray">
<li>超时了当前节点自动运动到下一个环节，如果要控制特定的条件下不向下运动，就需要在当前节点的发送前事件里编写相关的业务逻辑。</li>
</ul>
</fieldset>


<fieldset>
<legend><input type="radio" value="2"  id="RB_OutTimeDeal_2" name="RB_OutTimeDeal" /> <label for="RB_OutTimeDeal_2">跳转到指定的节点 </label> </legend>
 
    <ul style=" color:Gray">
    <li> 要跳转到的节点: <select id="DDL_Nodes" name="DDL_Nodes" > </select>
    </li>
    </ul>
</fieldset>



<fieldset>
<legend><input type="radio" value="3"  id="RB_OutTimeDeal_3" name="RB_OutTimeDeal" /> <label for="RB_OutTimeDeal_3">移交给指定的人员 </label> </legend>

     <a href="javascript:ShowHidden('shift');" > 请输入要移交的工作人员：</a>
 <div id="shift" style="display:none">
  <ul>
   <li>接受输入的必须是人员的工作帐号。</li>
   <li>如果有多个人元用半角的逗号分开，比如: zhangsan,lisi。</li>
   <li>超时后就自动的移交给指定的工作人员。</li>
  </ul>
  </div>
      
  <input id="TB_Shift" name="TB_Shift"  type="text"  />
</fieldset>


<fieldset>
<legend><input type="radio" value="4"  id="RB_OutTimeDeal_4" name="RB_OutTimeDeal" /> <label for="RB_OutTimeDeal_4">给指定的人员发送消息. </label> </legend>

     <a href="javascript:ShowHidden('emps');" > 请输入要发送的工作人员：</a>
 <div id="emps" style="display:none">
  <ul>
   <li>接受输入的必须是人员的工作帐号。</li>
   <li>如果有多个人元用半角的逗号分开，比如: zhangsan,lisi。</li>
   <li>超时后，系统就会向这些人员发送消息。</li>
  </ul>
  </div>
  <input id="TB_SendEmps" name="TB_SendEmps"  type="text"  />
   
</fieldset>


<fieldset>
<legend><input type="radio" value="5"  id="RB_OutTimeDeal_5" name="RB_OutTimeDeal" /> <label for="RB_OutTimeDeal_5">删除流程 </label> </legend>

 <ul style=" color:Gray">
  <li>超时后就自动删除当前的流程。</li>
</ul>
</fieldset>


<fieldset>
<legend><input type="radio" value="6"  id="RB_OutTimeDeal_6" name="RB_OutTimeDeal" /> <label for="RB_OutTimeDeal_6">执行SQL </label> </legend>

  <a href="javascript:ShowHidden('sql');" > 请输入要执行的SQL：</a>
 <div id="sql" style="display:none">
  <ul>
   <li>当前的的sql支持ccbpm的表达式.</li>
   <li>执行相关的SQL，处理相关的业务逻辑。</li>
  </ul>
  </div>

  <textarea id="TB_SQL" name="TB_SQL" rows="3"> </textarea>
</fieldset>


<fieldset>
<legend>其他选项 </legend>
<input type="checkbox" id="CB_IsEval" name="CB_IsEval" /><label for="CB_IsEval">是否质量考核点</label>  
</fieldset>
</td>
</tr>

<tr>
<td valign="top" >
<input type="button" value="保存" onclick="Save()" /> <div style="float:right" id="Msg"> </div>
</td>
</tr>

</table>




<script type="text/javascript">

    function Save() {

        $("#Msg").html("正在保存,请稍后......");

        var frmData = $("#cc").serialize();

        var checked = document.getElementById("CB_IsEval").checked;
        if (checked == true)
            checked = 1;
         else
             checked = 0;

        var myurl = Handler + "?DoType=CHOvertimeRole_Save&FK_Node=" + GetQueryString("FK_Node") + "&IsEval=" + checked + "&m=" + Math.random();
        $.ajax({
            data: frmData,
            type: 'post',
            async: true,
            url: myurl,
            dataType: 'html',
            success: function (data) {

                if (data.indexOf('err@') != -1) {

                    $("#Msg").html("<font color=red>" + data + "</font>");
                    return;
                }

                $("#Msg").html("<font color=green>" + data + "</font>");
                return;
            },
            error: function (data) {
                alert(data);
                console.info(data);
            }
        });
    }
</script>

</form>

</body>
</html>
